The present technique relates to a method, apparatus and system for diagnosing a processor executing a stream of instructions.
It is known to provide data processing systems with diagnostic mechanisms which can be used to perform diagnostic operations (e.g. software and hardware fault identification and analysis (debug)) upon the data processing systems so as to assist in the development of hardware, operating systems, application programs, overall system designs and the like.
One useful diagnostic approach is the ability to control a processor to single step through a program. In accordance with such an approach, the processor will execute a single instruction and then a diagnostic exception will be taken to allow the state of the system to be analysed.
One problem that can arise when single stepping through code is if code is encountered that has a different execution path when an exception is taken between instructions. This can be particularly problematic if the different execution path creates an infinite loop, as can happen when performing single stepping in respect of a section of code including a load exclusive instruction and an associated store exclusive instruction. This issue is discussed in commonly owned U.S. Pat. No. 8,839,038, the entire contents of which are hereby incorporated by reference, that patent describing an improved mechanism for dealing with such instructions, by identifying when an instruction such as a load exclusive instruction has been single stepped, and then temporarily exiting single stepping in order to allow an alternative mechanism to be implemented.
It would be desirable to further improve the efficiency of the process of diagnosing a processor executing a stream of instructions in situations where the execution path of the code may change by virtue of an exception being taken between instructions.